<link href="../Public/css/skin.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../Public/js/jquery-1.4.3.min.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>编辑用户组</title>

<style type="text/css">
	<!--
	body {
		margin-left: 0px;
		margin-top: 0px;
		margin-right: 0px;
		margin-bottom: 0px;
		background-color: #EEF2FB;
	}
	-->
</style>

<script language="javascript">
	function selectAll(){
		$("#list input[type='checkbox']").attr("checked",true);
	}
	
	function clearAll(){
		$("#list input[type='checkbox']").attr("checked",false);
	}
	
	$(document).ready(function(){
		$('.model').click(function(){
			id = "void"+$(this).val();
			if($(this).attr("checked")){
				$("#"+id+" input[type='checkbox']").attr("checked",true);
			}else{
				$("#"+id+" input[type='checkbox']").attr("checked",false);
			}
		});	
	
		$('.void').click(function(){
			id = $(this).parent().attr('id');
			id = id.replace("void","model");
			model = $("#"+id);
			if(!model.attr("checked")){
				model.attr("checked",true);
			}
		});	
		
	});

</script>

<body>

	<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td width="17" valign="top"
				background="../Public/images/mail_leftbg.gif"><img
				src="../Public/images/left-top-right.gif" width="17" height="29" />
			</td>
			<td valign="top" background="../Public/images/content-bg.gif">
				<table
					width="100%" height="31" border="0" cellpadding="0" cellspacing="0"
					class="left_topbg" id="table2">
					<tr>
						<td height="31"><div class="titlebt">编辑用户组</div>
						</td>
					</tr>
				</table>
			</td>
			<td width="16" valign="top"
				background="../Public/images/mail_rightbg.gif"><img
				src="../Public/images/nav-right-bg.gif" width="16" height="29" />
			</td>
		</tr>
		
		<tr>
			<td valign="middle" background="../Public/images/mail_leftbg.gif">&nbsp;</td>
			<td valign="top" bgcolor="#F7F8F9">
				<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
					<tr>
						<td valign="top" class="td_top"></td>
					</tr>
					<tr>
						<td>
							<form method="post" id="list" action="__URL__/update">
								<table width="100%" border="0" cellpadding="3" cellspacing="0" bgcolor="#CCCCCC" class="content">
									<tr>
										<td class="edit_left">用户组名：</td>
										<td class="edit_right"><input type="hidden" name="id"
											id="id" value="{$data.id}"> <input type="text"
											name="name" id="name" value="{$data.name}" class="edit_input">
										</td>
									</tr>
									<tr>
										<td class="edit_left">所属组：</td>
										<td class="edit_right">
											<div class="edit_select">
												<select name="pid">
													<option value="0">无</option>
													   <!-- 遍历角色组 -->
													<iterate name="roledata" id="v">
													  <eq	name="data['pid']" value="$v['id']">   <!-- 后台过滤掉了当前角色组，此处判断无用 -->
														<option value="{$v.id}" selected>{$v.name}</option>
													    <else />
														<option value="{$v.id}">{$v.name}</option>
													 </eq> 
													</iterate>
												</select>
											</div>
										</td>
									</tr>
									
									<tr>
										<td class="edit_left">状态：</td>
										<td class="edit_right">
										   <if condition="$data.status eq 1">  <!-- 启用状态1 -->
											 <input type="radio" name="status" value="1" checked="checked">启用
											 <input type="radio" name="status" value="0">禁用
										   <elseif condition="$data.status eq 0" />
										     <input type="radio" name="status" value="1">启用
										     <input type="radio" name="status" value="0" checked="checked">禁用
										   <else />
											<input type="radio" name="status" value="1">启用
											<input type="radio" name="status" value="0">禁用
										 </if>
									  </td>
									</tr>
									
									<tr>
										<td class="edit_left">权限：</td>  <!-- 全选和反选 -->
										<td class="edit_right">
										 <a href="javascript:selectAll()" class="operation_selectAll"></a> 
										 <a href="javascript:clearAll()" class="operation_clearAll"></a>
										</td>
									</tr>
									
									<iterate name="nodedata" id="vo">
										<tr>
											<td class="edit_left">{$vo['title']}：</td>
											<td class="edit_right">
											  <if condition="in_array($vo['id'],$accessdata)">   <!-- 功能模块已经设置 -->
											    <input type="checkbox" name="node[]" checked="checked"
													value="{$vo['id']}" class="model" id="model{$vo['id']}">模块
											   <else /> 
											    <input type="checkbox" name="node[]"
													value="{$vo['id']}" class="model" id="model{$vo['id']}">模块
												</if>
											</td>
										</tr>
										<tr>
											<td class="edit_left"></td>
											<td class="edit_right" id="void{$vo['id']}">   <!-- 功能模块下属操作功能权限 -->
											  <iterate   name="vo['son']" id="val">
											     <if condition="in_array($val['id'],$accessdata)"> 
											      <input type="checkbox" name="node[]" checked="checked"
													value="{$val['id']}" class="void">{$val['title']}
												 <else />
													<input type="checkbox" name="node[]" value="{$val['id']}"
														class="void">{$val['title']} 
												 </if> 
											</iterate>
										 </td>
									  </tr>
									</iterate>
									<tr>
										<td colspan="2">  <!-- 确定 -->
										<a href="javascript:list.submit();" id="submit" class="operation_submit"
											style="margin-left: 430px; margin-top: 30px;"></a>
										</td>
									</tr>
								</table>
							</form>
						</td>
					</tr>
					
					<tr>
						<td height="40"></td>
					</tr>
					
					<tr>
						<td width="51%" class="left_txt"><img
							src="../Public/images/icon-mail2.gif" width="16" height="11">
							客户服务邮箱：{$Think.config.sysconfig.services_email}<br> <img
							src="../Public/images/icon-phone.gif" width="17" height="14">
							官方网站：{$Think.config.sysconfig.website}</td>
					</tr>
				</table>
			</td>
			<td background="../Public/images/mail_rightbg.gif">&nbsp;</td>
		</tr>
		
		<tr>
			<td valign="bottom" background="../Public/images/mail_leftbg.gif"><img
				src="../Public/images/buttom_left2.gif" width="17" height="17" />
			</td>
			<td background="../Public/images/buttom_bgs.gif"><img
				src="../Public/images/buttom_bgs.gif" width="17" height="17">
			</td>
			<td valign="bottom" background="../Public/images/mail_rightbg.gif"><img
				src="../Public/images/buttom_right2.gif" width="16" height="17" />
			</td>
		</tr>
		
	</table>
</body>
